package com.app.serve.exception;

import com.app.serve.enums.ErrorCodeEnum;

public class JsonRespException extends Exception {
    private final Integer code;
    private final String msg;

    public JsonRespException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public JsonRespException(ErrorCodeEnum errorCodeEnum) {
        this(errorCodeEnum.getCode(), errorCodeEnum.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
